package priv.conceit.sc.hoxton.common.web.security;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import priv.conceit.sc.hoxton.common.entity.auth.authority.dto.CurrentUserInfoDTO;

import java.util.Collection;

/**
 *
 *
 * @author Conceit
 * 2019/4/22 增加方法
 * @since 1.0.0, 2019/4/22
 */
@Data
public class WebUserDetail implements UserDetails {

	private CurrentUserInfoDTO currentUserInfoDTO;

	private Collection<? extends GrantedAuthority> authorities;

	@Override
	@JsonIgnore
	public Collection<? extends GrantedAuthority> getAuthorities() {
		return authorities;
	}

	@Override
	@JsonIgnore
	public String getPassword() {
		return null;

	}

	@Override
	@JsonIgnore
	public String getUsername() {
		return null;
	}

	@JsonIgnore
	@Override
	public boolean isAccountNonExpired() {
		return false;
	}

	@JsonIgnore
	@Override
	public boolean isAccountNonLocked() {
		return false;
	}

	@JsonIgnore
	@Override
	public boolean isCredentialsNonExpired() {
		return false;
	}

	@JsonIgnore
	@Override
	public boolean isEnabled() {
		return false;
	}
}
